X_LIBS += libxlibc.a

PROJ_NAME = open-npstack

NAME		:= open-npstack.xapp
SRC			+= main.c

X_INCDIRS	+= $(PROJ_NAME)/include/
X_INCDIRS	+= $(PROJ_NAME)/port/include/

SRC  += one_shot_timer.c onps_entry.c onps_errors.c onps_input.c onps_utils.c

SRC += bsd/socket.c ethernet/arp.c ethernet/ethernet.c ip/icmp.c ip/ip.c ip/tcp.c ip/tcp_link.c ip/tcp_options.c ip/udp.c ip/udp_link.c 
SRC +=  mmu/buddy.c mmu/buf_list.c netif/netif.c netif/route.c 
SRC +=  port/os_adapter.c port/eth.c
SRC +=  net_tools/ping.c

#SRC +=  port/include/port/datatype.h port/include/port/os_datatype.h port/include/port/os_adapter.h port/include/port/sys_config.h 

define CUSTOM_TARGET_CMD
echo [APP] $@; \
$(LD) $(X_LDFLAGS) $(X_OBJS) -o $@ $(patsubst %, -L%, $(X_LIBDIRS)) \
	--start-group $(patsubst %, -l:%, $(X_LIBS)) --end-group; \
$(OD) -D -S $@ > $@.dump.S
endef
